<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'north',border:false">
		<div class="queryContent" style="height: 32px;">
			<form name="taskSearchForm" id="taskSearchForm" method="post" action="" style="display: none; ">
				<table class="queryTable" >
					<tbody>
						<tr>
							<th width="60%" style="text-align: right;">任务状态</th>
							<td width="10%">
								<input id="selTaskStatusCombobox" class="easyui-combobox" style="width:100px" data-options="panelHeight:'auto',onSelect:function(sys){$('#executeResultDiv').val(sys.value);}"/>
								<input type="hidden" name="executeResult" id="executeResultDiv"/>	
							</td>
							<th width="10%" style="text-align: right;">任务时间</th>
							<td width="10%">
								<input id="selTaskStartTimeCombobox" class="easyui-datetimebox" name="startDate" style="width:150px" /> - 
								<input id="selTaskEndTimeCombobox" class="easyui-datetimebox" name="endDate" style="width:150px" />	
							</td>
						  	<td align="right" width="10%"><a href="javascript:void(0);" class="easyui-linkbutton" id="recordSearch"  plain="true">查询</a>
								<a href="javascript:void(0);" class="easyui-linkbutton" id="recordResetSearch" plain="true">清空</a>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
	<div data-options="region:'center',border:true">
			<table id="recordListTable" class="easyui-datagrid" 
				data-options="singleSelect:false,method:'post',rownumbers:true,fit:true,fitColumns:true,border:false,
					pagination:true,remoteSort:true,multiSort:true,striped:true,pageSize:20"}>
				<thead>
					<tr>
						<th data-options="field:'taskCode',width:40,sortable:true,align:'center',halign:'center',title:'任务编码'"></th>
						<th data-options="field:'executeTime',width:50,align:'center',title:'执行时间',sortable:true"></th>
						<th data-options="field:'executeResultName',width:30,align:'center',title:'执行结果'"></th>
						<th data-options="field:'executeErrorMessage',width:200,align:'left',title:'错误信息'"></th>
					</tr>
				</thead>
			</table>
	</div>
</div>
<script type="text/javascript">
		//初始化表格对应的js对象
		var recordParamObj;
		$(function() {
			//初始化表格对象数据
			recordParamObj = new initParams(
					{
						paramObjName : 'recordParamObj',//表格对应的实体对象名称，好区分多个表格情况下的对象
						tableId:'recordListTable',
						searchFormID:'taskSearchForm',
						searchID:'recordSearch',
						resetSearchID:'recordResetSearch',
						showDialogId:'firstLevelDialog',
						addDialogTitle:'任务记录',
						addDialogWidth:1120,
						addDialogHeight:688
					});
			//初始化查询
			init(recordParamObj);
			$.getJSON('/comm-dictionary-server/dictionary/findDictionaryByParentValue?sysCode=common&parentValue=task_execute_result',function(jsonData){
				$('#selTaskStatusCombobox').combobox({
					data:jsonData.data,
					valueField:'value',
					textField:'name'
				});
			});
			$('#recordListTable').datagrid({url:'/comm-schedule-server/task/recordList?taskCode='+taskCode});
		});
	</script>